import { http } from "@/utils/http";
import httpConfig from "@/utils/http/httpConfig";

// 菜单列表
export function menuLists(params?: Record<string, any>) {
  return http.request<any>("post", httpConfig.system + "/menu/list", {
    data: params
  });
}

// 添加菜单
export function menuAdd(params: Record<string, any>) {
  return http.request<any>("post", httpConfig.system + "/menu", {
    data: params
  });
}

// 编辑菜单
export function menuEdit(params: Record<string, any>) {
  return http.request<any>("post", httpConfig.system + "/menu/edit", {
    data: params
  });
}

// 菜单删除
export function menuDelete(params: Record<string, any>) {
  return http.request<any>("post", httpConfig.system + "/menu/del/" + params);
}

// 菜单xiangqy
export function menuDetail(params: Record<string, any>) {
  return http.request<any>("get", httpConfig.system + "/menu/" + params);
}
/**
 * 获取菜单树 treeselect格式
 * @param params
 * @returns
 */
export function treeselect(params: Record<string, any>) {
  return http.request<any>("post", httpConfig.system + "/menu/treeselect", {
    data: params
  });
}

/**
 * 获取菜单树 sysmenu格式
 * @param params
 * @returns
 */
export function listTree(params: Record<string, any>) {
  return http.request<any>("post", httpConfig.system + "/menu/listTree", {
    data: params
  });
}
